﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SIOsystem.Control;

namespace SIOsystem
{
    public partial class LoginForm : Form
    {
        public string uname = "";
        public long id = -1;
        public LoginForm()
        {
            InitializeComponent();
        }

        private void loginButton_Click(object sender, EventArgs e)
        {
            if (LoginClass.login(userNameTextBox.Text, passwordTextBox.Text))
            {
                uname = userNameTextBox.Text;
                id = LoginClass.getOID(userNameTextBox.Text, passwordTextBox.Text);
                this.DialogResult = DialogResult.OK; 
            }
            else
            {
                MessageBox.Show("用户名或密码错!");
            }
        }
    }
}
